package main

import (
	_ "go-web/docs"
	initRouter "go-web/initRouter"
	"net/http"
	"time"

	"github.com/gin-gonic/gin"
)

// @title Gin web
// @version 1.0
// @description Gin web

// @contact.name xiaotao
// @contact.url https://gitee.com/suntiiny
// @contact.email 506755679@qq.com

// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html

// @host localhost:8010
func main() {
	router := initRouter.SetupRouter()

	// 启动程序，最终调用 http.ListenAndServe
	_ = router.Run(":8010")
}

// 自定义的 http config
func customMain() {
	router := gin.Default()

	s := &http.Server{
		Addr:           ":8080",
		Handler:        router,
		ReadTimeout:    10 * time.Second,
		WriteTimeout:   10 * time.Second,
		MaxHeaderBytes: 1 << 20,
	}
	s.ListenAndServe()
}
